#include "Shm.hpp"
#include "Fifo.hpp"

int main()
{
    // 文件操作
    FileOper writeFile(CURRENTPATH, FILENAME);
    writeFile.OpenForWrite();

    // 映射共享内存
    Shm shm(PATHNAME, PROJID, USER);
    char *mem = (char *)shm.VirtualAddr();
    int index = 0;
    for (char c = 'A'; c <= 'F'; c++, index += 2)
    {
        sleep(1);
        mem[index] = c;
        mem[index + 1] = c;
        sleep(1);
        //mem[index + 2] = 0;
        writeFile.WakeUp();
    }

    return 0;
}